<template>
  <view class="c-sort-wrap">
    <slot></slot>
  </view>
</template>
<script setup>
import { View } from '@tarojs/components';
import { anyType } from '@/hooks';
import { provide } from 'vue';
import { sortKey } from '@/constants';

const modelValue = defineModel(anyType(null));

const modelDesc = defineModel('desc', {
  type: Boolean,
  default: false
});

const emit = defineEmits(['change']);
provide(sortKey, {
  onChange() {
    emit('change', {
      value: modelValue.value,
      desc: modelDesc.value
    });
  },
  modelDesc,
  modelValue
});
</script>
<style lang="scss">
.c-sort-wrap {
  display: flex;
  height: 88px;
  justify-content: space-between;
  align-items: center;
}
</style>
